﻿using System.Diagnostics;

namespace TogNet.BusinessObjects
{
    public class DosShell
    {
        public static string ExecuteCommand(string command)
        {
            ProcessStartInfo procStartInfo = new ProcessStartInfo("cmd", "/c " + command)
                                                 {
                                                     RedirectStandardOutput = true,
                                                     UseShellExecute = false,
                                                     CreateNoWindow = true
                                                 };

            Process proc = new Process { StartInfo = procStartInfo };
            proc.Start();
            return proc.StandardOutput.ReadToEnd();
        }
    }
}